package com.googlecode.curvedmetromaps.core.logic.localsearch.geneticalgorithm;

import com.googlecode.curvedmetromaps.core.model.MetroMap;

public class Organism implements Comparable<Organism> {

	public MetroMap map;

	public float mutationRate = 0.001f;
	
	public double cost;

	public Organism(MetroMap map) {
		this.map = new MetroMap(map);
	}

	public Organism(MetroMap map, float mutationRate) {
		this(map);
		this.mutationRate = mutationRate;
	}

	public Organism(Organism o) {
		this(o.map, o.mutationRate);
		this.cost = o.cost;
	}
	
    @Override
    public int compareTo(Organism o2) {
    	return Double.compare(this.cost, o2.cost);
    }
}
